/**
 * \class GenDoubleExp.h /GenProg/AbsSyn/GenExpClasses/GenDoubleExp.h
 *
 *  \date 22 maj 2012
 *  \author ytc0039
 *  
 *  \brief 
 */

#ifndef GENDOUBLEEXP_H_
#define GENDOUBLEEXP_H_
#include <Interfaces/IGenExp.h>
#include <AbsSyn/DoubleExp.h>

class GenDoubleExp : public IGenExp
{
private:
	DoubleExp::genDblExpFun m_GenFun;
public:
	explicit GenDoubleExp(DoubleExp::genDblExpFun genFun):
	m_GenFun(genFun)
	{

	}

	virtual AbsSyn::IExpPtr genExp(GenExp::GenExpPtr genExpPtr) const
	{
		return m_GenFun();
	}

	virtual int getExpNrArg() const
	{
		return 0;
	}

	/**
	 *  \brief Does the type match the expression
	 *
	 *  When the generator creates a new expression
	 *  it is necessary to know if the type matches
	 *  the choosen expression.
	 *
	 * @param type
	 * @return true if it matches
	 */
		virtual bool isTypeMatch(TypeEnum type) const{
			bool ret = false;
			if( type == TypeEnum::DoubleT)
			{
				ret = true;
			}

			return ret;
		}
};

#endif /* GENDOUBLEEXP_H_ */
